package net.huashitong.user.service;

import com.sirdc.modules.core.dao.BaseDao;
import com.sirdc.modules.sys.base.StringPKService;
import com.sirdc.modules.sys.service.SysTableService;
import net.huashitong.user.dao.LoginRecordDao;
import net.huashitong.user.entity.Collection;
import net.huashitong.user.entity.LoginRecord;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional
public class LoginRecordService extends StringPKService<LoginRecord> {

    @Autowired
    private LoginRecordDao dao;
    @Autowired
    private SysTableService tableService;

    @Override
    protected BaseDao<LoginRecord, String> getDao() {
        return dao;
    }
    @Override
    protected void beforeSave(LoginRecord loginRecord) {
        loginRecord.setSysId(tableService.updateMaxSysId("t_gis_login_record", null));
    }
}
